<?php
// $Id: index.class.php 123 2011-12-29 10:08:50Z tomqin@gmail.com $

class default_Controller extends FrontController{

	function init(){
		$this->seoTitle('大连外卖订餐美食网');
	}

	function onIndex(){
		if(array_get_bool($_GET, 'force'))
			$html = '';
		else
			$html = Cache::get('dl.homepage', 24*3600);
		
		if(!$html){
			$zone = Base::loadModule('zone', true);
			$zone->initCity();

			$shopList = DB::getAll('select res_id, name, picture, zone_id, subzone_id from `t_store` where city_deliver = 0 order by rand() limit 23');

			$this->setVar('zoneInfo', $zone);
			$this->setVar('shopList', $shopList);
			$this->render('default-index');

			$html = ob_get_contents();
			ob_end_clean();
			Cache::set('dl.homepage', $html);
		}
		echo $html;
	}

}
?>